<template>
  <div class="event-card">
    <div class="event-header">
      <h2>{{ row.personName }}</h2>
      <p class="event-time">{{ row.createTime }}</p>
    </div>
    <p class="event-description">{{ row.feedbackContent }}</p>
    <image-gallery :images="feedbackPicUrlList" />
  </div>
</template>

<script>
import ImageGallery from "../../../components/ImageGallery.vue";
export default {
  name: 'EventCard',
  components:{ImageGallery},
  data(){
    return{}
  },
  props: {
    row: {
      type: Object,
      required: true
    }
  },
  computed:{
    feedbackPicUrlList(){
      let imgList = this.row.feedbackPicUrlList && this.row.feedbackPicUrlList.split(',') || []
      return imgList.map(item => {
        return {
          src: item
        }
      })
    }
  },
  methods: {
    handleClick() {
      this.$emit('view-details', this.row);
    }
  }
}
</script>

<style lang="scss" scoped>
.event-card {
  border-radius: 8px;
  padding: 12px;
  background: $uni-color-success;
  margin-bottom: 12px;
  .event-header {
    margin-bottom: 8px;
    h2 {
      font-size: 18px;
      margin: 0;
    }

    .event-time {
      font-size: 14px;
      color: #666;
    }
  }
  .event-description {
    font-size: 14px;
    color: #333;
    margin-bottom: 10px;
  }
}
</style>
